package com.lxy.cxcyxmmsbackend.sys.controller;


import com.lxy.cxcyxmmsbackend.sys.entity.QxglCd;
import com.lxy.cxcyxmmsbackend.sys.req.PageReq;
import com.lxy.cxcyxmmsbackend.sys.res.Result;
import com.lxy.cxcyxmmsbackend.sys.service.QxglCdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 菜单管理
 * @author 刘新颖
 * @since 2024-01-11
 */
@Api(tags = "权限管理_菜单")
@RestController
@RequestMapping("/qxglCd")
public class QxglCdController {

    @Resource
    QxglCdService qxglCdService;

    @ApiOperation("查询菜单")
    @RequestMapping("selectQxglCds")
    Result selectQxglCds() {
        return qxglCdService.selectQxglCds();
    }

    @ApiOperation("模糊查询菜单")
    @RequestMapping("selectQxglCdByCdMc")
    Result selectQxglCdByCdMc(@RequestBody PageReq pageReq) {
        return qxglCdService.selectQxglCdByCdMc(pageReq.getKeyWord().get("cdmc"));
    }

    @ApiOperation("新增菜单")
    @RequestMapping("insertQxglCd")
    Result insertQxglCd(@RequestBody QxglCd qxglCd) {
        return qxglCdService.insertQxglCd(qxglCd);
    }

    @ApiOperation("修改菜单")
        @RequestMapping("updateQxglCd")
    Result updateQxglCd(@RequestBody QxglCd qxglCd) {
        return qxglCdService.updateQxglCd(qxglCd);
    }

    @ApiOperation("删除菜单")
    @RequestMapping("deleteQxglCd/{cdBh}")
    Result deleteQxglCd(@PathVariable("cdBh") String cdBh) {
        return qxglCdService.deleteQxglCd(cdBh);
    }
}

